package com.alit.face.koala;

import org.springframework.boot.Banner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Import;
import org.springframework.core.env.Environment;

import com.alit.face.koala.config.ApplicationContextAwareImpl;
import com.litong.utils.ip.IPUtil;

/**
 * @author litong
 * @date 2019年4月16日_下午12:38:18
 * @version 1.0
 */
@SpringBootApplication
@Import({ ApplicationContextAwareImpl.class })
public class FaceKoalaApplication {
  private static Environment e;

  public static void main(String[] args) {
    long start = System.currentTimeMillis();
    SpringApplication app = new SpringApplication(FaceKoalaApplication.class);
    app.setBannerMode(Banner.Mode.OFF);
    app.run(args);
    long end = System.currentTimeMillis();
    System.out.println((end - start) + "ms");
    e = ApplicationContextAwareImpl.getBean(Environment.class);
    IPUtil.printAccessUrl(Integer.parseInt(e.getProperty("server.port")), e.getProperty("server.servlet.context-path"));
  }
}
